package com.qing.common.utils.json.hutool;

import java.util.Arrays;

public enum ConvertorEnum {

    VALUE1("1", "value1","第一"),

    VALUE2("2", "value2","第二"),


    VALUE3("3","value3","第三");


    private final String field1;


    private final String field2;

    private final String field3;

    ConvertorEnum(String field1, String field2, String field3) {
        this.field1 = field1;
        this.field2 = field2;
        this.field3 = field3;
    }

    public String getField1() {
        return field1;
    }

    public String getField2() {
        return field2;
    }

    public String getField3() {
        return field3;
    }

    public static ConvertorEnum fromField1(String field1) {
        return Arrays.stream(values()).filter(v -> v.field1.equals(field1)).findFirst().orElse(null);
    }


    public static ConvertorEnum fromField2(String field2) {
        return Arrays.stream(values()).filter(v -> v.field2.equals(field2)).findFirst().orElse(null);
    }


}
